//- Copyright (c) 2016 Lucky Byte, Inc.
extends trstat

append form_items
  .field.two.wide
    .ui.labeled.dropdown.selection.input.status
      input(type="hidden" name="succed" value="#{succed || 'none'}")
      i.icon.dropdown
      .default.text 所有交易
      .menu
        .item(data-value="none") 所有交易
        .item(data-value="true") 成功交易
        .item(data-value="false") 失败交易

  .field.seven.wide
    .ui.buttons.right.floated.small.compact
      button.ui.green.button.labeled.icon(type="submit") 查 询
        i.icon.search

block thead
  tr
    th.collapsing.center.aligned 序号
    th.center.aligned 交易渠道
    th.center.aligned 交易名称
    th.center.aligned 交易笔数
    th.center.aligned 交易金额
    th.center.aligned 手续费

block tbody
  each record, index in records
    tr
      td.collapsing.center.aligned= index + 1
      td.center.aligned #{record.chnl}-#{constant.merch_chnls[record.chnl]}
      td.center.aligned= record.trname
      td.center.aligned
        a.link.trlist(href="#"
          data-trcode="#{record.trcode || ''}"
          data-chnl="#{record.chnl || ''}"
          data-incoming="false"
          data-settl="true"
          data-succed="#{succed || ''}")
          = record.total_cnt || 0
      td.center.aligned ¥ #{fmtamt(record.total_amt)}
      td.center.aligned ¥ #{record.total_fee}
  else
      td.center.aligned.warning(colspan="6") 无数据
